###
 # @Company: TWL
 # @Author: xue jian
 # @Email: xuejian@kanzhun.com
 # @Date: 2020-05-07 15:14:10
 ###
#!/bin/bash

yestday=`date -d "-1days" +%Y-%m-%d`
echo $yestday
sh train_data.sh $yestday

sh bossrec_train_time_rank.sh $yestday

#del the invalid files
lastweek=`date -d "-8days" +%Y-%m-%d`
echo $lastweek
del_file=/user/datastar/arc/six/warehouse/arc_six_dev/bossrec_train_negative/ds=$lastweek
hadoop fs -rm -f -r $del_file

del_file=/user/datastar/arc/six/warehouse/arc_six_dev/bossrec_train_exposure/ds=$lastweek
hadoop fs -rm -f -r $del_file

del_file=/user/datastar/arc/six/warehouse/arc_six_dev/bossrec_train/ds=$lastweek
hadoop fs -rm -f -r $del_file


del_file=/user/arc_six/pos_neg_sample/neg_sample_out/$lastweek
hadoop fs -rm -f -r $del_file
del_file=/user/arc_six/pos_neg_sample/train_data_out/$lastweek
hadoop fs -rm -f -r $del_file

source /data1/zangruozhou/zrzn/bin/activate

nohup python -u /data1/xuejian/sync/offline_train/flash/cut_cascade_data.py $yestday >> /data1/xuejian/sync/offline_train/flash/cut_cas_result 2>&1 &

last40d=`date -d "-40days" +%Y-%m-%d`
echo $last40d
del_file=/data3/training_data/galaxy_data_new/$last40d
mv $del_file /data1/xuejian/sync/data_backups
echo $del_file

del_file=/data3/training_data/galaxy_data_cut/$last40d
mkdir -p /data1/xuejian/sync/data_backups/cut
mv $del_file /data1/xuejian/sync/data_backups/cut
echo $del_file